package com.spring.util;

import android.graphics.Bitmap;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;

public class ImageOptions {


	
	
	
	public static DisplayImageOptions getUserHeadImageOptions(int res){
		
		DisplayImageOptions options = new DisplayImageOptions.Builder()
		.showImageOnLoading(res)
		.showImageForEmptyUri(res)
		.showImageOnFail(res)
		.cacheInMemory(true) 
		.cacheOnDisk(true)
		.considerExifParams(true)
		.displayer(new RoundedBitmapDisplayer(5))
		.build();
		
		return options;
		
	}
	
	public static DisplayImageOptions getBigPicOptions(int res){
		
		DisplayImageOptions options = new DisplayImageOptions.Builder()
		.showImageForEmptyUri(res)
		.showImageOnFail(res)
		.showImageOnLoading(res)
		.cacheInMemory(true) 
		.cacheOnDisk(true)
		.considerExifParams(true)
		.resetViewBeforeLoading(true)
		.imageScaleType(ImageScaleType.EXACTLY)
		.bitmapConfig(Bitmap.Config.ARGB_8888)
		.displayer(new FadeInBitmapDisplayer(300))
		.build();
		
		return options;
		
	}
	public static DisplayImageOptions getLoadImageOptions(){
		
		DisplayImageOptions options = new DisplayImageOptions.Builder()
		.cacheInMemory(true) 
		.cacheOnDisk(true)
		.considerExifParams(true)
		.imageScaleType(ImageScaleType.EXACTLY)
		.bitmapConfig(Bitmap.Config.ARGB_8888)
		.build();
		
		return options;
		
	}
	
	public static DisplayImageOptions getOriginalPicOptions(int res){
		
		DisplayImageOptions options = new DisplayImageOptions.Builder()
		.showImageOnLoading(res)
		.showImageForEmptyUri(res)
		.showImageOnFail(res)
		.cacheInMemory(true) 
		.cacheOnDisk(true)
		.considerExifParams(true)
		.build();
		
		return options;
		
	}
	
	

}
